export function getCopyInfo(code, type) {
  if (code == 0) {
  } else if (code == 999) {
    if (type == 'html') {
      return ``
    }
    if (type == 'js') {
      return ``
    }
    if (type == 'css') {
      return ``
    }
  } else if (code == 16) {
    if (type == 'html') {
      return `
  <el-form-item label="开始时间">
      <el-date-picker v-model="form.time2" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日"
          value-format="yyyy-MM-dd" :picker-options="pickerOptions0">
      </el-date-picker>
  </el-form-item>`
    }
    if (type == 'js') {
      return `data() {
        return {
            pickerOptions0: {
                disabledDate(time) {
                    return time.getTime() < Date.now() - 8.64e7;
                }
            },
        }
    },`
    }
    if (type == 'css') {
      return ``
    }
  } else if (code == 15) {
    if (type == 'html') {
      return `
  <el-form-item label="开始时间">
      <el-date-picker v-model="form.strTime" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日"
          value-format="yyyy-MM-dd" @change="changTime">
      </el-date-picker>
  </el-form-item>
  <el-form-item label="结束时间">
      <el-date-picker v-model="form.endTIme" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日"
          value-format="yyyy-MM-dd" @change="changTime">
      </el-date-picker>
  </el-form-item>`
    }
    if (type == 'js') {
      return `
      changTime() {
        //自动分配开始结束时间
        if (this.form.strTime && this.form.endTIme) {
            if (this.form.strTime > this.form.endTIme) {
                let str = this.form.endTIme
                this.form.endTIme = this.form.strTime
                this.form.strTime = str
            }
        }
      }`
    }
    if (type == 'css') {
      return ``
    }
  } else if (code == 14) {
    if (type == 'html') {
      return `
      <el-form-item label="时间范围">
          <el-date-picker v-model="form.time3" type="daterange" range-separator="至"
             start-placeholder="开始日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd"
             end-placeholder="结束日期">
          </el-date-picker>
      </el-form-item>`
    }
    if (type == 'js') {
      return ``
    }
    if (type == 'css') {
      return ``
    }
  } else if (code == 13) {
    if (type == 'html') {
      return `
  <el-form-item label="开始时间">
      <el-date-picker v-model="form.time2" type="date" placeholder="选择日期" format="yyyy 年 MM 月 dd 日"
          value-format="yyyy-MM-dd">
      </el-date-picker>
  </el-form-item>`
    }
    if (type == 'js') {
      return ``
    }
    if (type == 'css') {
      return ``
    }
  } else if (code == 12) {
    if (type == 'html') {
      return `
  <el-form-item label="开始时间">
      <el-date-picker v-model="form.time1" type="date" placeholder="选择日期">
      </el-date-picker>
  </el-form-item>`
    }
    if (type == 'js') {
      return ``
    }
    if (type == 'css') {
      return ``
    }
  } else if (code == 11) {
    if (type == 'html') {
      return `
    <el-form-item label="盈利">
      <el-input v-model="form1.name4" style="width: 400px" maxlength="20" show-word-limit  type="number"></el-input>
    </el-form-item>`
    }
    if (type == 'js') {
      return ``
    }
    if (type == 'css') {
      return ``
    }
  } else if (code == 10) {
    if (type == 'html') {
      return `
    <el-form-item label="数字编码">
      <el-input v-model="form1.name3" style="width: 400px" maxlength="20" show-word-limit  oninput="value=value.replace(/[^\d]/g,'')"></el-input>
    </el-form-item>`
    }
    if (type == 'js') {
      return ``
    }
    if (type == 'css') {
      return ``
    }
  } else if (code == 9) {
    if (type == 'html') {
      return `
    <el-form-item label="电话">
      <el-input v-model="form1.name2" style="width: 400px" maxlength="20" show-word-limit  oninput="value=value.replace(/\D|^0/g,'')"></el-input>
    </el-form-item>`
    }
    if (type == 'js') {
      return ``
    }
    if (type == 'css') {
      return ``
    }
  } else if (code == 8) {
    if (type == 'html') {
      return `
      <el-form-item label="活动名称">
          <el-input v-model="form1.name1" style="width: 400px" maxlength="20" show-word-limit></el-input>
      </el-form-item>`
    }
    if (type == 'js') {
      return ``
    }
    if (type == 'css') {
      return ``
    }
  } else if (code == 7) {
    if (type == 'html') {
      return `
      <el-card class="box-card">
        <el-form ref="form" :model="form" :rules="rules" label-width="80px">
          <el-form-item label="活动名称" prop="name">
            <el-input v-model="form.name" style="width: 400px;"></el-input>
          </el-form-item>
          <el-form-item label="活动区域" prop="region">
            <el-select v-model="form.region" placeholder="请选择活动区域">
              <el-option label="区域一" value="shanghai"></el-option>
              <el-option label="区域二" value="beijing"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="活动时间" prop="date1">
            <el-col :span="11">
              <el-date-picker type="date" placeholder="选择日期" v-model="form.date1"
                style="width: 400px;"></el-date-picker>
            </el-col>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="onSubmit('form')">立即创建</el-button>
            <el-button @click="resetForm('form')">重置</el-button>
          </el-form-item>
        </el-form>
      </el-card>`
    }
    if (type == 'js') {
      return ` form: {
        name: '',
        region: '',
        date1: '',
      },
      rules: {
        name: [
          { required: true, message: '请输入活动名称', trigger: 'blur' },
          { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
        ],
        region: [
          { required: true, message: '请选择活动资源', trigger: 'change' }
        ],
        date1: [
          { required: true, message: '请选择活动资源', trigger: 'change' }
        ]
      },
       onSubmit(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          alert('submit!');
        } else {
          console.log('error submit!!');
          return false;
        }
      });
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
    }`
    }
    if (type == 'css') {
      return ``
    }
  } else if (code == 6) {
    if (type == 'html') {
      return `
    <div style="text-align: right;">
      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
        :current-page="pageFrom.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="pageFrom.currentPageSize"
        layout="total, sizes, prev, pager, next" :total="total">
      </el-pagination>
    </div>`
    }
    if (type == 'js') {
      return `
      total: 400, //数据数量
      pageFrom: {
        currentPage: 1,  //当前页数
        currentPagesize: 10, //一页多少条
      }
      handleSizeChange(val) {
        console.log('每页' ,val,' 条');
        this.pageFrom.currentPagesize = val
        console.log(this.pageFrom)
      },
      handleCurrentChange(val) {
        console.log('当前页:' ,val);
        this.pageFrom.currentPage = val
        console.log(this.pageFrom)
      },
      getList() {
        let data = {
          ...this.search_form,
          currentPage: this.ruleForm.pageNum,
          currentPageSize: this.ruleForm.pageSize,
        }
        getList(data).then(r => {
          if (r.code == 200) {
            this.tableData = r.data.records
            this.count = r.data.total
            // 删除最后一页最后一条数据请求上一页数据
            if ((this.ruleForm.pageNum - 1) * this.ruleForm.pageSize == this.count) {
              this.ruleForm.pageNum = this.ruleForm.pageNum - 1
              this.getList()
            }
          } else {
            Message.error({
              message: r.msg,
            });
          }
        })
      }
      `
    }
    if (type == 'css') {
      return ``
    }
  } else if (code == 5) {
    if (type == 'html') {
      return `
          <el-button @click="chooseAll">全 选</el-button>
          <el-button @click="chooseUnAll" type="primary">反 选</el-button>
          <el-button @click="chooseCancel" type="primary">取 消</el-button>
          <!-- 
            border 表格
            default-sort 排序
            stripe 隔行斑马线
           -->
          <el-table ref="multipleTable" :data="tableData" border style="width: 100%;margin-top: 10px;"
            :default-sort="{ prop: 'date', order: 'descending' }" stripe @selection-change="handleSelectionChange">
            <el-table-column type="selection" width="55" align="center">
            </el-table-column>
            <el-table-column prop="date" label="日期" align="center">
            </el-table-column>
            <el-table-column prop="name" label="姓名" align="center">
            </el-table-column>
            <!-- 
            sortable 需要排序的添加字段
           -->
            <el-table-column prop="age" label="年龄（排序）" align="center" sortable>
            </el-table-column>
            <el-table-column prop="address" label="地址" align="center">
            </el-table-column>
            <el-table-column prop="addressLong" label="地址(超出隐藏)" align="center">
              <template slot-scope="scope">
                <el-tooltip popper-class="tps" :content="scope.row.addressLong" placement="top-start" :open-delay="1000">
                  <div class="overHide">{{ scope.row.addressLong }}</div>
                </el-tooltip>
              </template>
            </el-table-column>
            <el-table-column fixed="right" label="操作" width="120" align="center">
              <template slot-scope="scope">
                <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
                <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
                <el-button @click="del(scope.row)" type="text" size="small">删除</el-button>
              </template>
            </el-table-column>
          </el-table>`
    }
    if (type == 'js') {
      return ` tableData: [{
            date: '2016-05-02',
            name: '王小虎25',
            age: '25',
            address: '上海市普陀区金沙江路 1518 弄',
            addressLong: '上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄',
          }, {
            date: '2016-05-02',
            name: '王小虎17',
            age: '17',
            address: '上海市普陀区金沙江路 1518 弄',
            addressLong: '上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄',
          }, {
            date: '2016-05-02',
            name: '王小虎30',
            age: '30',
            address: '上海市普陀区金沙江路 1518 弄',
            addressLong: '上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄',
          }, {
            date: '2016-05-02',
            name: '王小虎30',
            age: '31',
            address: '上海市普陀区金沙江路 1518 弄',
            addressLong: '上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄',
          }],
          
          multipleSelection: [],//选中的行
          
          handleClick(val) {
            console.log(val)
          },
          del() {
            this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              this.$message.success('删除成功');
            }).catch(() => {
              this.$message.info('已取消删除');
            });
          },
          //选择点击
          handleSelectionChange(val) {
            this.multipleSelection = val;
          },
          //全选
          chooseAll() {
            this.tableData.forEach(row => {
              this.$refs.multipleTable.toggleRowSelection(row, true);
            });
          },
          //反选
          chooseUnAll() {
            this.tableData.forEach(row => {
              this.$refs.multipleTable.toggleRowSelection(row);
            });
          },
          //取消选中
          chooseCancel() {
            this.$refs.multipleTable.clearSelection();
          },`
    }
    if (type == 'css') {
      return `
           .overHide {
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
          }
          <style>
          .tps.el-tooltip__popper {
            max-width: 300px;
            /* background: red; */
          }

          .tps.el-tooltip__popper.is-dark {
            background: #777;
          }

          .tps.el-tooltip__popper.is-light {
            background: red;
          }
          </style>
          `
    }
  } else if (code == 4) {
    if (type == 'html') {
      return `  <!-- 
          border 表格
          default-sort 排序
          stripe 隔行斑马线
         -->
        <el-table :data="tableData" border style="width: 100%" :default-sort="{ prop: 'date', order: 'descending' }"
          stripe>
          <el-table-column type="index" label="序号" width="50" align="center">
          </el-table-column>
          <el-table-column prop="date" label="日期" align="center">
          </el-table-column>
          <el-table-column prop="name" label="姓名" align="center">
          </el-table-column>
          <!-- 
          sortable 需要排序的添加字段
         -->
          <el-table-column prop="age" label="年龄（排序）" align="center" sortable>
          </el-table-column>
          <el-table-column prop="address" label="地址" align="center">
          </el-table-column>
          <el-table-column prop="addressLong" label="地址(超出隐藏)" align="center">
            <template slot-scope="scope">
              <el-tooltip popper-class="tps" :content="scope.row.addressLong" placement="top-start" :open-delay="1000">
                <div class="overHide">{{ scope.row.addressLong }}</div>
              </el-tooltip>
            </template>
          </el-table-column>
          <el-table-column fixed="right" label="操作" width="120" align="center">
            <template slot-scope="scope">
              <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
              <el-button @click="handleClick(scope.row)" type="text" size="small">编辑</el-button>
              <el-button @click="del(scope.row)" type="text" size="small">删除</el-button>
            </template>
          </el-table-column>
        </el-table>`
    }
    if (type == 'js') {
      return `tableData: [{
            date: '2016-05-02',
            name: '王小虎25',
            age: '25',
            address: '上海市普陀区金沙江路 1518 弄',
            addressLong: '上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄',
          }, {
            date: '2016-05-02',
            name: '王小虎17',
            age: '17',
            address: '上海市普陀区金沙江路 1518 弄',
            addressLong: '上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄',
          }, {
            date: '2016-05-02',
            name: '王小虎30',
            age: '30',
            address: '上海市普陀区金沙江路 1518 弄',
            addressLong: '上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄',
          }, {
            date: '2016-05-02',
            name: '王小虎30',
            age: '31',
            address: '上海市普陀区金沙江路 1518 弄',
            addressLong: '上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄上海市普陀区金沙江路 1518 弄',
          }],
          handleClick(val) {
            console.log(val)
          },
          del() {
            this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              this.$message.success('删除成功');
            }).catch(() => {
              this.$message.info('已取消删除');
            });
          },
          `
    }
    if (type == 'css') {
      return `
          .overHide {
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
          }
          <style>
          .tps.el-tooltip__popper {
            max-width: 300px;
            /* background: red; */
          }
          
          .tps.el-tooltip__popper.is-dark {
            background: #777;
          }
          
          .tps.el-tooltip__popper.is-light {
            background: red;
          }
          </style>`
    }
  } else if (code == 3) {
    if (type == 'html') {
      return `<el-card class="box-card">
            <div class="operate_location">
              <el-button>重 置</el-button>
              <el-button type="primary">查 询</el-button>
            </div>
          </el-card>`
    }
    if (type == 'js') {
      return ``
    }
    if (type == 'css') {
      return `.operate_location {
                text-align: right;
              }`
    }
  } else if (code == 2) {
    if (type == 'html') {
      return `<el-card class="box-card">
            <el-row>
              <el-col :span="8">
                <div>
                  <el-form-item label="活动名称">
                    <el-input v-model="ruleForm.name"></el-input>
                  </el-form-item>
                </div>
              </el-col>
              <el-col :span="8">
                <div>
                  <el-form-item label="活动区域">
                    <el-select v-model="ruleForm.region" placeholder="请选择活动区域">
                      <el-option label="区域一" value="shanghai"></el-option>
                      <el-option label="区域二" value="beijing"></el-option>
                    </el-select>
                  </el-form-item>
                </div>
              </el-col>
              <el-col :span="8">
                <div>
                  <el-form-item label="活动时间">
                    <el-col :span="11">
                      <el-date-picker type="date" placeholder="选择日期" v-model="ruleForm.date1"
                        style="width: 100%;"></el-date-picker>
                    </el-col>
                  </el-form-item>
                </div>
              </el-col>
            </el-row>
          </el-card>`
    }
    if (type == 'js') {
      return ` data() {
                return {
                  ruleForm: {
                    name: "",
                    region: '',
                    date1: '',
                  }
                }
              },`
    }
    if (type == 'css') {
      return ``
    }
  } else if (code == 1) {
    if (type == 'html') {
      return `<el-card class="box-card">
            <div class="clickChoose">
              <span> 状态:</span>
              <el-button @click="choose(0)" class="btn" :class="type == 0 ? 'click' : ''"> 全部</el-button>
              <el-button @click="choose(1)" class="btn" :class="type == 1 ? 'click' : ''"> 已审核</el-button>
              <el-button @click="choose(2)" class="btn" :class="type == 2 ? 'click' : ''"> 未审核</el-button>
              <el-button @click="choose(3)" class="btn" :class="type == 3 ? 'click' : ''"> 已审批</el-button>
              <el-button @click="choose(4)" class="btn" :class="type == 4 ? 'click' : ''"> 未审批</el-button>
            </div>
          </el-card>`
    }
    if (type == 'js') {
      return `  data() {
                return {
                  type: 0,
                }
              },
              methods: {
                choose(val) {
                  this.type = val
                },
              }`
    }
    if (type == 'css') {
      return `.clickChoose {
                span {
                  display: inline-block;
                  height: 40px;
                  line-height: 40px;
                  margin-right: 10px;
                }
              
                .btn {
                  margin: 0;
                }
              
                .click {
                  background-color: #409eff;
                  color: #fff;
                }
              }`
    }
  } else {
    return ''
  }

}